//
//  CLBaseResult.m
//  togetherLBS
//
//  Created by louis on 15/7/30.
//  Copyright (c) 2015年 celi. All rights reserved.
//

#import "CLBaseResult.h"
//#import "MJExtension.h"

@implementation CLBaseResult

- (void)setDid:(NSString *)did
{
    _did = did;
    _device_id = did;
}

- (void)setFid:(NSString *)fid
{
    _fid = fid;
    _friend_id = fid;
}

- (void)setFace:(NSString *)face
{
    _face = face;
    _head_icon = face;
}

- (void)setR:(NSNumber *)r
{
    _r = r;
    
    if (r.intValue > 1) {
        _err = [NSNumber numberWithInt:r.intValue];
        
    }
}

- (NSString *)errorMessage
{
    if (self.msg) return self.msg;
    
    NSString *errorName = [NSString stringWithFormat:@"error%d", self.r.intValue];
    NSString *errorMsg = CLLocalizedString(errorName, nil);
    return errorMsg;
}
@end
